package cz.semjobKB.controller.api;


import cz.semjobKB.knowledge.api.IExtractedKnowledge;
import cz.semjobKB.virtuoso.utils.ETriplePart;

import java.io.File;

/**
 * Interface provides methods that interconnects view module and model modules. It takes requests from view, calls
 * model components and passes results back to the view
 */
public interface IController {

    /**
     * For selected file and search strategy it runs text extraction, linguistic processing, information extraction.
     * It passes the extracted knowledge back to view so the user can select which knowledge should be stored
     * and which discarded
     * @param documentFile  Document to be processed
     * @param fileStrategy  Search strategy configuration
     */
	void processDocument(File documentFile, File fileStrategy);

    /**
     * Gets detail about a resource. Possible textual representation, URI.
     * @param triplePart    For which part of the triple to look for or null for terminology
     * @param resourceName  Resource name
     */
	void resourceDetail(ETriplePart triplePart, String resourceName);

    /**
     * Searches for triples based on the provided parameters. If one of the parameter is missing, then it searches for
     * any triples containing the other parameters. Passes the result back to the view.
     * Example: Subject, Predicate filled -> It searches for triples having the same subject, predicate and on object
     * place can be anything
     * @param subject       Subject part of the triples
     * @param predicate     Predicate part of the triple
     * @param object        Object part of the triple
     */
	void suggestTriples(String subject, String predicate, String object);

    /**
     * Finds document based on the full or partial triple specified in the parameters. For every found document,
     * the full detail about it is loaded from the database
     * @param subject   Subject
     * @param predicate Predicate
     * @param object    Object
     */
	void findDocument(String subject, String predicate, String object);

    /**
     * Finds document based on the terminology. For every found document,
     * the full detail about it is loaded from the database
     * @param terminology   Terminology search parameter
     */
	void findDocument(String terminology);

    /**
     * Stores extracted knowledge and the given file in a database.
     * @param finalKnowledge    Extracted knowledge
     * @param storedFile        File from which information was extracted
     */
    void storeFinalDocument(IExtractedKnowledge finalKnowledge, File storedFile);

	
}
